using IQIGame.Onigao.Framework;
using IQIGame.Onigao.GamePlay;

namespace IQIGame.Onigao.Logic
{
    public static class ConditionLevelLogicUtil
    {
        public static (bool, int) Check(int conditionId, LevelRegion region, LevelPlayer player, LevelEntity curEntity = null)
        {
            (bool, int) result;
            var blackboard = ClassPool<ConditionBlackboard>.Get();
            {
                blackboard.enviroment = region;
                blackboard.curPlayer = player;
                blackboard.curEntity = curEntity;
                result = ConditionModule.Instance.Check(conditionId, blackboard);
            }
            ClassPool<ConditionBlackboard>.Put(blackboard);
            return result;
        }
    }
}
